﻿using Microsoft.ServiceModel.Web;
using System.ServiceModel.Web;
using System.ServiceModel;
using System.Xml.Linq;

namespace WCFCollection
{
	/// <summary>
	/// Stores url templates.
	/// </summary>
	public static class URITemplates
	{
		public const string XmlItemsLinqTemplate = "{collection}/linq/?linq={linq}";
	}

	[ServiceContract]
	public interface ICollectionService
	{
		/// <summary>
		/// Gets the result of linq in XML.
		/// </summary>
		/// <param name="collection">The collection.</param>
		/// <param name="linq">The linq.</param>
		/// <returns>Result of linq query.</returns>
		[WebGet(UriTemplate = URITemplates.XmlItemsLinqTemplate)]
		[OperationContract]
		XElement GetResultLinqInXml(string collection, string linq);
	}
}
